import 'package:demo202112/MyAnimation/wy_animation_widget.dart';
import 'package:demo202112/utils/common_appbar.dart';
import 'package:flutter/material.dart';

/// @Author wywinstonwy
/// @Date 2022/1/23 7:57 下午
/// @Description:

class WyAlignPage extends StatefulWidget {
  const WyAlignPage({Key? key}) : super(key: key);

  @override
  _WyAlignPageState createState() => _WyAlignPageState();
}

class _WyAlignPageState extends State<WyAlignPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(appBar: getAppBar('Align'), body: _buildFractionalOffset());
  }

  Widget get _buildAlign {
    return Container(
        height: 120,
        width: 120,
        color: Colors.amber.shade50,
        child: Align(
            alignment: Alignment.topRight,
            child: Container(
              height: 60,
              width: 60,
              color: Colors.red,
              child: const Align(
                alignment: Alignment.topLeft,
                child: FlutterLogo(
                  size: 44,
                ),
              ),
            )));
  }
  _buildAlignment(){
    return  Container(
      color: Colors.blue.shade50,
      child: const Align(
      widthFactor: 2,
      heightFactor: 2,
      alignment: Alignment(2.0,0),
      child: FlutterLogo(size: 60,),
    ),);
  }
  _buildFractionalOffset(){
    return Container(
      height: 120,
      width: 120,
      color: Colors.blue[50],
      child: const Align(alignment: FractionalOffset(0.2,0.9),
        child: FlutterLogo(size: 60,),
      ),
    );
  }
}
